/*
 * Copyright (c) 2005 -2008 Reliable Source, Inc. and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Mozilla Public License v.1.1,
 * BSD, and Eclipse Public License v1.0 which accompanies this
 * distribution and is available at:
 *
 * 		http://www.eclipse.org/legal/epl-v10.html
 * 		http://www.opensource.org/licenses/bsd-license.php
 * 		http://www.mozilla.org/MPL/MPL-1.1.html
 *
 * Contributors:
 *     IBM Corporation	     -  http://ibm.com
 *     	- initial API and implementation
 *
 *     patientos.org         - http://patientos.org
 *     	- domain and database persistence layer
 *
 *     Reliable Source, Inc. - http://reliablesource.org
 *     	- Symbiosys Application Framework,
 *     	- Symbiosys Application, Symbiosys Product
 *
 */
package org.reliablesource.symbiosys.ui.tests.mockobjects;

import org.eclipse.core.runtime.IProgressMonitor;

import org.eclipse.ui.IPropertyListener;
import org.eclipse.ui.part.EditorPart;


/**
 *
 * ReliableViewerContentContainer.java
 * Created on: Oct 3, 2006
 * @author Dennis Park
 *      <a href="mailto:denpark@cisco.com">denpark@cisco.com</a>
 *
 */
public class ReliableViewerContentContainer implements IPropertyListener {
    public boolean isDirty = false;
    public Object input;

    public void addChildPage(Object _object) {
    }

    public void close(boolean _save) {
    }

    public void doSave(IProgressMonitor _monitor) {
    }

    public Object getInput() {
        return input;
    }

    public boolean isDirty() {
        return isDirty;
    }

    public void setDirty(boolean _dirty) {
        if (isDirty != _dirty) {
            isDirty = _dirty;
            System.err.println("Container Dirtied.");
        }
    }

    public void setInput(Object _input) {
        input = _input;
    }

    /* (non-Javadoc)
     * @see com.cisco.nm.cmp.client.ui.composites.ICMPContentContainer#openChildPage(java.lang.Object)
     */
    public void openChildPage(Object _object) {
    }

    /* (non-Javadoc)
     * @see org.eclipse.ui.ISaveablePart#doSaveAs()
     */
    public void doSaveAs() {
    }

    /* (non-Javadoc)
     * @see org.eclipse.ui.ISaveablePart#isSaveAsAllowed()
     */
    public boolean isSaveAsAllowed() {
        return false;
    }

    /* (non-Javadoc)
     * @see org.eclipse.ui.ISaveablePart#isSaveOnCloseNeeded()
     */
    public boolean isSaveOnCloseNeeded() {
        return false;
    }

    public void propertyChanged(Object source, int propId) {
        if (propId == EditorPart.PROP_DIRTY)
            isDirty = !isDirty;
    }
}
